package com.sansan.qiangji.controller.open;

import com.sansan.qiangji.VO.system.menu.MenuVO;
import com.sansan.qiangji.realize.system.MenuReal;
import com.sansan.qiangji.resultVO.ResultVO;
import com.sansan.qiangji.utils.ResultVOUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@CrossOrigin()
@RestController
@RequestMapping("/open")
@Slf4j
public class OpenController {
    private MenuReal menuReal;

    @Resource
    public void setMenuReal(MenuReal menuReal) {
        this.menuReal = menuReal;
    }

    @GetMapping("/list")
    public ResultVO<Object> getMenus() {
        MenuVO menuVO = menuReal.getMenus();
        return ResultVOUtil.success(menuVO);
    }
}
